package com.techstar.ats.codec.live.decoder;

import io.netty.buffer.ByteBuf;
import com.techstar.ats.codec.MessageDecoder;
import com.techstar.ats.dxp.live.rep.F10TrainIndicationUpdate;
import com.techstar.ats.type.UpdateType;

public enum F10TrainIndicationUpdateDecoder implements MessageDecoder<F10TrainIndicationUpdate> {
	INSTANCE;

	public F10TrainIndicationUpdate create() {
		return new F10TrainIndicationUpdate();
	}

	public void decode(ByteBuf buf, F10TrainIndicationUpdate value) {
		value.line = buf.readUnsignedShort();
		value.type = UpdateType.valueOf(buf.readUnsignedShort());
		value.indication.hasRoute = true;
		TrainIndicationDecoder.INSTANCE.decode(buf, value.indication);
	}
}
